//
//  RBTextField.m
//  FD
//
//  Created by Yasin on 2018/10/16.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "RBTextField.h"
@interface RBTextField()
/**线*/
@property (nonatomic,  strong) UIView *lineView;
@end

@implementation RBTextField

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.lineView];

        //清除按钮
        self.clearButtonMode = UITextFieldViewModeWhileEditing;
    }
    return self;
}

- (void)layoutSubviews {

    //长时间加班导致效率极其低下，
    // 10-16 一定要调用父类的方法、会导致莫名的bug
    [super layoutSubviews];
    
    self.lineView.frame = CGRectMake(0, self.bounds.size.height - 1, self.bounds.size.width, 1);
}
- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = kMainLightGrayColor;
    }
    return _lineView;
}

@end
